package com.heima.model.comment.dtos;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
@NotNull(message = "CommentDTO 不能为空")
public class CommentDTO {
    @NotNull(message = "articleId 不能为空")
    private Long articleId;
    // 最小时间
    private Date minDate;
    //是否是首页
    private Short index;
    // 每页条数
    private Integer size;

    public void check(){
        if (this.getSize()==null || this.getSize() == 0){
            setSize(10);
        }
        if (this.getMinDate() == null){
            setMinDate(new Date());
        }

    }
}